Full Outer Join

The FULL OUTER JOIN returns a result set that includes rows from both left and right tables. When no matching rows exist for the row in the left table, the columns of the right table will have nulls. Similarly, when no matching rows exist for the row in the right table, the column of the left table will have nulls. The following shows the syntax of the FULL OUTER JOIN when joining two tables T1 and T2:

In this syntax:
  • First, specify the left table T1 in the FROM clause.
  • Second, specify the right table T2 and a join predicate.
  • The following Venn diagram illustrates the FULL OUTER JOIN of two result sets:

SQL Server Full Outer Join illustration


No comments:

Post a Comment